import { computed, ref } from "vue";

function useSearch(datalist) {
    const searchText = ref("");
    const computedDataList =  computed(()=>{
        datalist.value.filter(item => item.content.includes(searchText.value))
    })
    console.log(searchText.value);
    console.log(datalist.value);
    
    return{
        searchText,
        computedDataList
    }
}

export default useSearch;